"""
题目：将一个正整数分解质因数。例如：输入90,打印出90=2*3*3*5。
"""


import math


def answer1():
    """
    自己分析:先获取该正整数内的所有质数，再去质因数
    :return:
    """
    print("输出一", end=":")
    print("1", end=" x ")
    fibs = [2, 3, 5]
    n = 79
    if n >= 6:
        for i in range(6, n + 1, 6):
            for num in (i - 1, i + 1):
                if num < n:
                    sqrtNum = math.sqrt(num)
                    for j in (5, sqrtNum + 1, 6):
                        if num % j == 0 or num % (j + 2) == 0:
                            break
                    else:
                        fibs.append(num)
    f = 0
    a = n
    m = 0
    while a > 0:
        if fibs.__contains__(a):
            print(a)
            break
        a, m = divmod(a, fibs[f])
        if m == 0:
            n = a
            print(fibs[f], end=" x ")
            f = 0
        else:
            a = n
            f += 1
        if f >= len(fibs) or a < fibs[f]:
            print(a)
            break


answer1()
